import { get, post, del } from "../utils/request";

/**
 * 药品列表
 * @param {*} page
 * @returns
 */
export const loadGoodsAPI = (page, keyword, per) =>
  get("/medicines", { page, keyword, per });

/**
 * 获取药品详情
 * @param {*} id
 * @returns
 */
export const loadGoodsDataById = (id) => get("/medicines/" + id);

/**
 * 加入购物车
 * @param {*} data
 * @returns
 */
export const addGoodsAPI = (data) => post("/members/shop_carts", data);

/**
 * 获取购物车数据
 * @returns
 */
export const loadCartAPI = () => get("/members/shop_carts");

/**
 * 删除购物车数据
 * @param {*} id
 * @returns
 */
export const delCartAPI = (id) => del("/members/shop_carts?id=" + id);
